/**
 * webAssembly库
 */
use wasm_bindgen::prelude::*;
mod utils;
mod structs;

#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC:wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

#[wasm_bindgen]
extern "C" {
    pub fn alert(str: &str);
}

#[wasm_bindgen]
pub fn greet(name: &str) {
    let res = utils::fib::run(20);
    let str = format!("hello,{}, the result is {}", name, res.to_string());
    alert(&str);
}